/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.inspur.edp.lcm.metadata.api.service;

import com.inspur.edp.lcm.metadata.api.entity.GspMetadata;
import com.inspur.edp.lcm.metadata.api.entity.MetadataDto;
import java.util.List;

/**
 * 功能描述:零代码元数据服务
 *
 * @ClassName: NoCodeService
 * @Author: Fynn Qi
 * @Date: 2021/5/25 14:16
 * @Version: V1.0
 */
public interface NoCodeService {

    /**
     * 用于新建元数据之前初始化元数据实体
     *
     * @param metadata 元数据基础信息，不包含各元数据content
     * @return 元数据初始化实体
     */
    GspMetadata initMetadata(GspMetadata metadata);

    /**
     * 保存元数据
     *
     * @param metadata 元数据实体
     * @return 保存成功后返回的元数据实体
     */
    GspMetadata saveMetadata(GspMetadata metadata);

    /**
     * 根据元数据唯一标识获取元数据
     *
     * @param metadataId 元数据id
     * @return 元数据实体
     */
    GspMetadata getMetadata(String metadataId);

    /**
     * 将元数据从设计表中发布到运行表
     *
     * @param metadataId 元数据ID
     * @return 发布成功，返回true，发布失败，返回false
     **/
    boolean publishMetadata(String metadataId);

    /**
     * 删除元数据
     *
     * @param metadataId 元数据id
     */
    void deleteMetadata(String metadataId);

    /**
     * 根据业务对象id查询元数据
     *
     * @param bizObjectID 业务对象id
     * @return
     */
    List<MetadataDto> getMetadataListInBO(String bizObjectID);

}
